package com.andnnl.template;

import com.andnnl.template.param.BaseParamConfig;
import com.andnnl.template.param.DateParamConfig;
import com.andnnl.template.param.DoubleParamConfig;
import com.andnnl.template.param.EnumParamConfig;
import com.andnnl.template.param.IntParamConfig;
import com.andnnl.template.param.LongParamConfig;
import com.andnnl.template.param.RegexParamConfig;
import com.andnnl.template.param.StringParamConfig;

public class ParamConfigFactory {
    public static BaseParamConfig create(String type) {
        switch (type) {
            case "string":
                return new StringParamConfig();
            case "int":
                return new IntParamConfig();
            case "long":
                return new LongParamConfig();
            case "double":
                return new DoubleParamConfig();
            case "regex":
                return new RegexParamConfig();
            case "date":
                return new DateParamConfig();
            case "enum":
                return new EnumParamConfig();
            default:
                throw new IllegalArgumentException("未知参数类型: " + type);
        }
    }
}